package com.jenkins.test.proxy.gov.web;

import com.jenkins.test.proxy.gov.business.GovStandardService;
import com.jenkins.test.proxy.gov.constant.GovStandardSigmoid;
import com.jenkins.test.proxy.gov.dto.reponse.RegistrationResponse;
import com.jenkins.test.proxy.gov.dto.request.RegistrationRequest;
import com.jenkins.test.response.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @version V1.0.0
 * @ClassName: {@link GovTestController}
 * @Description: GovTestController
 * @author: Lanzhou
 * @date: 2022/1/22 15:32
 * @Copyright:2020 All rights reserved.
 */
@RestController
@RequestMapping("/gov")
public class GovTestController {

    @Resource
    private GovStandardService govStandardService;


    /**
     * 测试下拉
     *
     * @return 返回
     */
    @RequestMapping("/test")
    public Result<RegistrationResponse> test() {
        RegistrationRequest request = new RegistrationRequest();
        request.setCreditCode("91350206302896340N");
        request.setEnterpriseCode("91350206302896340N");
        request.setRegion("350203");
        GovStandardSigmoid standard = GovStandardSigmoid.REGISTRATION;
        request.setRequestType(standard.getReqType());
        request.setRequestUrl("https://www.necc.gov.cn");
        RegistrationResponse response = govStandardService.registration(request);
        return Result.success(response);
    }


}
